package com.jackykeke.kdatabasedemo

import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.jackykeke.kdatabasedemo.db.dao.GameDao
import com.jackykeke.kdatabasedemo.db.helper.DatabaseHelper
import com.jackykeke.kdatabasedemo.db.helper.GameDBHelper

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)


//        while (!mDBHelper.insertDefaultDataSuccess) {
//
//            if (mDBHelper.insertDefaultDataSuccess) {
//                dao.isNum5Game()
//            }
//        }

        val auto = findViewById<TextView>(R.id.auto)
        auto.postDelayed({
            val mDBHelper = DatabaseHelper(MainApplication.getApplication())
            val dao = GameDao(mDBHelper)
            dao.isNum5Game()
        }, 3000)


    }
}